Passed
Push — master ( 65fa19...207748 )
by Jesús
02:02
created

test-utils.ts ➔ mockWordlistResponse   A

Complexity

Conditions 1

Size

Total Lines 4
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
1
import { state } from '../src/core/state';
2
3
export function resetState(): void {
4
  state.boxes.fill(false);
5
  state.wordlist = [];
6
  state.currentLanguage = 'english';
7
}
8
9
export const mockWordlist = [
10
  'abandon', 'ability', 'able', 'about', 'above', 'absent', 'absorb', 'abstract',
11
  'absurd', 'abuse', 'access', 'accident', 'account', 'accuse', 'achieve', 'acid',
12
  'acoustic', 'acquire', 'across', 'act', 'action', 'actor', 'actress', 'actual'
13
];
14
15
export function mockWordlistResponse(words: string[] = mockWordlist) {
16
  return Promise.resolve({
17
    text: () => Promise.resolve(words.join('\n')),
18
  });
19
}
20